#include <iostream>
#include <signal.h>

void handler(int sig)
{
    std::cout<< "Get a sig" << sig << std::endl;
}
int main()
{
    signal(2, handler);
    signal(3, handler);
    signal(4, handler);
    signal(5, handler);
    while(true)
    {
        std::cout<< "pid: " << getpid() << std::endl;
        sleep(2);
    }

    return 0;
}